import { createRouter, createWebHistory } from "vue-router"

const routes = [
    {
        path: '/',
        redirect:'/crm'
    },
    {
        path: '/crm',
        redirect: '/crm/workbench',
        component: () => import('../views/crm/CRM.vue'),
        children: [
            {
                path: 'workbench',
                component: () => import('../views/crm/Workbench.vue')
            }
        ]
    },
    {
        path: '/task',
        component: () => import('../views/Task.vue')
    },
    {
        path: '/log',
        component: () => import('../views/Log.vue')
    },
    {
        path: '/login',
        component: () => import('../views/Login.vue')
    },
    {
        path: '',
        component: () => import('../views/404.vue')
    }
]

export default createRouter({
    history: createWebHistory(),
    routes
})